import request from './requert.js'

export function detailSwiper(iid){
	return request({
		url:'/detail',
		params:{
			iid
		}
	})
}

export class Goods{
	constructor(columns,itemInfo,services) {
			this.title = itemInfo.title;
			this.desc = itemInfo.desc;
			this.oldPrice = itemInfo.oldPrice;
			this.discount = itemInfo.discountDesc;
			this.columns = columns;
			this.services = services;
			this.realPrice = itemInfo.lowNowPrice;
	}
}

export class Shop{
	constructor(shopInfo){
		this.logo = shopInfo.shopLogo;
		this.name = shopInfo.name;
		this.score = shopInfo.score;
		this.shopUrl = shopInfo.shopUrl;
		this.cSells = shopInfo.cSells;
		this.cGoods = shopInfo.cGoods;
	}
}

export class Cart{
	constructor(itemInfo){
		this.image = itemInfo.topImages[0];
		this.desc = itemInfo.desc;
		this.nowPrice = itemInfo.lowNowPrice;
		this.iid = itemInfo.iid;
		this.title = itemInfo.title;
		this.counter = 1;
		this.isShow = true
	}
}

//推荐数据
export function recommend(iid){
	return request({
		url:'/recommend',
		params:{
			iid
		}
	})
}